package com.hctrl.mybatis.controller;

import com.hctrl.mybatis.service.UserService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/user")
public class UserController implements InitializingBean {

    @Autowired
    private UserService orderServiceImpl;
    @Autowired
    private ApplicationContext applicationContext;

    @Override
    public void afterPropertiesSet() throws Exception {
        String[] beanNamesForType = applicationContext.getBeanNamesForType(UserService.class);
        System.out.println(beanNamesForType.length);
        System.out.println("userService = " + orderServiceImpl);
    }
}
